<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>编辑</title>
<%@include file="common/include.jsp"%>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-lg-8">
				<form id="form" role="form">
					<input type="hidden" id="id" name="id" value="${stoLog.id}">
					<div class="form-group">
						<label for="name">系统名称</label> <input type="text"
							class="form-control" id="systemName" name="systemName"
							value="${stoLog.systemName}" placeholder="请输入系统名称">
					</div>
					<div class="form-group">
						<label for="name">日志级别</label> <input type="text"
							class="form-control" id="logLevel" name="logLevel"
							value="${stoLog.logLevel}" placeholder="请输入日志级别">
					</div>
					<div class="form-group">
						<label for="name">日志内容</label> <input type="text"
							class="form-control" id="logContent" name="logContent"
							value="${stoLog.logContent}" placeholder="请输入日志内容">
					</div>
					<button type="button" onclick="save()" class="btn btn-default">保存</button>
					<button type="reset" class="btn btn-default">重置</button>
					<button type="button" class="btn btn-default"
						onclick="javascript:history.back(-1);">返回</button>
				</form>
			</div>
		</div>
	</div>
	<script>
		function save() {
			$.ajax({
				type : 'POST',
				url : '${ctx}/save',
				data : $('#form').serialize(),
				dataType : 'json',
				success : function(data) {
					alert(data.msg);
					if (data.success) {
						setTimeout('toIndex()', 100);
					}
				},
				error : function() {
					alert("出错了,请重试!");
				}
			});
		}
	</script>
</body>
</html>
